package com.hckj.medical.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hckj.medical.entity.Dictionary;
import com.hckj.medical.mapper.DictionaryMapper;
import com.hckj.medical.service.IDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hckj
 * @since 2023-11-25
 */
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements IDictionaryService {
    @Autowired
    private DictionaryMapper dictionaryMapper;

    /**
     * 根据belongs查询所有的状态
     * @param id
     * @return
     */
    @Override
    public List<Dictionary> selectByBlongId(Integer id) {
        LambdaQueryWrapper<Dictionary> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Dictionary::getBelongs,id);
        return dictionaryMapper.selectList(queryWrapper);
    }
}
